package com.jing.weibo.controller.system;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import com.jing.system.comm.BaseController;
import com.jing.weibo.service.system.StatisticsService;

/**
 * 通知信息的Controller
 * @author jing.yue
 * @version 2012/10/25 1.0.0
 */
@Controller
public class NotificationController extends BaseController {

	private static final Logger logger = Logger.getLogger(NotificationController.class);

	@Autowired
	private StatisticsService statisticsService;

	/**
	 * 获取最近列表
	 * @return
	 */
	/*@RequestMapping(value = "/statistics/json/findlatelyLoginUser")
	@ResponseBody
	public ModelMap findlatelyLoginUser(HttpServletRequest request, UserInfo user) {
		String result = null;
		String weiboMsg = null;
		Map<String, Object> map = null;
		UserInfo userInfo = getSessionUser(request);
		//不为管理员
		if(userInfo.getIsadmin().intValue() != 1) {
			logger.error(userInfo.getNickname() + ": 您不是管理员!");
			result = ERROR;
		}
		else {
			try {
				user.setUsername(userInfo.getUsername());
				map = statisticsService.findlatelyLoginUser(user);
				result = SUCCESS;
			} catch (WeiboException e) {
				logger.error(WeiboCons.getErrorMsg(e));
				result = ERROR_WEIBO;
				weiboMsg = WeiboCons.getErrorMsg(e);
			} catch (Exception e) {
				logger.error(userInfo.getNickname() + ": 获取最近登录的用户列表异常!", e);
				result = ERROR;
			}
		}
		ModelMap modelMap = new ModelMap();
		modelMap.put("data", map);
		modelMap.put("result", result);
		modelMap.put("weiboMsg", weiboMsg);
		return modelMap;
	}*/

}